<template>
  <div>
    <a-modal ref="modalRef" v-model:visible="visible" @ok="handleOk" :okText='"确认"'  :cancelText='"取消"' class="pop">
      <template #title>
        <div ref="modalTitleRef" style="width: 100%; cursor: move">{{ popTitle }}</div>
      </template>
      <a-form
          :model="formState"
          html-type="submit"
          name="time_related_controls"
          v-bind="formItemLayout"
          @finish="onFinish"
          @finishFailed="onFinishFailed"
      >
       <div class="form-horizontal-box">
         <div v-for="(item,index) in formList" :key="index">
           <a-form-item name="date-picker" :label=item.title :rules=item.bind v-if="item.type == 1">
             <a-input v-model:value="formState['date-picker']" :placeholder="'请输入' + item.title"/>
           </a-form-item>
           <a-form-item name="date-picker" :label=item.title :v-bind=item.bind v-if="item.type == 2">
             <a-input
                 :placeholder="'请输入' + item.title"
                 type="number"
                 v-model:value="inputValue"
                 placeholder="请输入项目数量"
                 :max-length="10"
             />
           </a-form-item>
           <a-form-item name="date-time-picker" :label=item.title :rules=item.bind v-if="item.type == 3">
             <a-date-picker
                 v-model:value="formState['date-time-picker']"
                 show-time
                 :placeholder="'请输入' + item.title"
                 format="YYYY-MM-DD HH:mm:ss"
                 value-format="YYYY-MM-DD HH:mm:ss"
             />
           </a-form-item>
           <a-form-item v-bind="config" :label=item.title v-if="item.type == 4" :rules=item.bind  class="textarea"  >
             <a-textarea class="textarea_input"   v-model:value="value" :rows="4" :placeholder="'请输入' + item.title" />
           </a-form-item>
         </div>
       </div>
        <a-form-item :wrapper-col="{ offset: 8, span: 16 }">
          <a-button  @click="close" class="close">取消</a-button>
          <a-button type="primary" html-type="submit" @ok="handleOk">确认</a-button>
        </a-form-item>
      </a-form>
      <template #modalRender="{ originVNode }">
        <div :style="transformStyle">111
          <component :is="originVNode"/>
        </div>
      </template>
    </a-modal>
  </div>
</template>

<script>
import pop from '../server/pop-up'
export default pop
</script>
<style  lang="less">
@import "../assets/css/style/popUp.less";

</style>